home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / ufw / before6.rules < prev    next >
Encoding:
Text File  |  2009-04-03  |  2.2 KB  |  58 lines

  1. #
  2. # rules.before
  3. #
  4. # Rules that should be run before the ufw command line added rules. Custom
  5. # rules should be added to one of these chains:
  6. #   ufw6-before-input
  7. #   ufw6-before-output
  8. #   ufw6-before-forward
  9. #
  10.  
  11. # Don't delete these required lines, otherwise there will be errors
  12. *filter
  13. :ufw6-before-input - [0:0]
  14. :ufw6-before-output - [0:0]
  15. :ufw6-before-forward - [0:0]
  16. # End required lines
  17.  
  18.  
  19. # allow all on loopback
  20. -A ufw6-before-input -i lo -j ACCEPT
  21. -A ufw6-before-output -o lo -j ACCEPT
  22.  
  23. # for stateless autoconfiguration (restrict NDP messages to hop limit of 255)
  24. -A ufw6-before-input -p icmpv6 --icmpv6-type neighbor-solicitation -m hl --hl-eq 255 -j ACCEPT
  25. -A ufw6-before-input -p icmpv6 --icmpv6-type neighbor-advertisement -m hl --hl-eq 255 -j ACCEPT
  26. -A ufw6-before-input -p icmpv6 --icmpv6-type router-solicitation -m hl --hl-eq 255 -j ACCEPT
  27. -A ufw6-before-input -p icmpv6 --icmpv6-type router-advertisement -m hl --hl-eq 255 -j ACCEPT
  28.  
  29. # connection tracking rules
  30. -A ufw6-before-input -m state --state RELATED,ESTABLISHED -j ACCEPT
  31.  
  32. # drop INVALID packets (logs these in loglevel medium and higher)
  33. -A ufw6-before-input -m state --state INVALID -j ufw6-logging-deny
  34. -A ufw6-before-input -m state --state INVALID -j DROP
  35.  
  36. # connection tracking for outbound
  37. -A ufw6-before-output -p tcp -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
  38. -A ufw6-before-output -p udp -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
  39.  
  40. # ok icmp codes
  41. -A ufw6-before-input -p icmpv6 --icmpv6-type destination-unreachable -j ACCEPT
  42. -A ufw6-before-input -p icmpv6 --icmpv6-type packet-too-big -j ACCEPT
  43. -A ufw6-before-input -p icmpv6 --icmpv6-type time-exceeded -j ACCEPT
  44. -A ufw6-before-input -p icmpv6 --icmpv6-type parameter-problem -j ACCEPT
  45. -A ufw6-before-input -p icmpv6 --icmpv6-type echo-request -j ACCEPT
  46.  
  47. # allow dhcp client to work
  48. -A ufw6-before-input -p udp --sport 67 --dport 68 -j ACCEPT
  49.  
  50. # allow MULTICAST
  51. -A ufw6-before-input -p icmpv6 -s ff00::1/8 -j ACCEPT
  52. -A ufw6-before-input -p icmpv6 -d ff00::1/8 -j ACCEPT
  53. -A ufw6-before-input -p icmpv6 -s ff00::2/8 -j ACCEPT
  54. -A ufw6-before-input -p icmpv6 -d ff00::2/8 -j ACCEPT
  55.  
  56. # don't delete the 'COMMIT' line or these rules won't be processed
  57. COMMIT
  58.